#include <stdio.h>
int main()
{
    for(char c;(c=getchar())!='#';putchar((c>='A'&&c<='Z')?(c-'A'+'a'):(c>='a'&&c<='z')?(c-'a'+'A'):c));
 	return 0;
}
